﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed

#pragma once

#include "ICurve3d.h"

namespace gcmp
{
    class ICurve2d;
    class Coordinate3d;
    class INurbsCurve3d;

    /// \brief 空间三维曲线
    ///
    class IPlaneCurve3d : public ICurve3d
    {
        DEFINE_CAST_DERIVED(gcmp::IPlaneCurve3d, gcmp::ICurve3d);
    public:
        /// \brief 根据坐标系和二维曲线构造空间平面曲线
        /// \param  coordinate3d      坐标系
        /// \param  opICurve2d   二维曲线
        /// \return  空间平面曲线
        GCMP_GEOMETRY_INTERFACE_EXPORT static OwnerPtr<IPlaneCurve3d> Create(
            const Coordinate3d& coordinate3d,
            OwnerPtr<ICurve2d> opICurve2d
        );

        /// \brief  获取平面曲线的坐标系
        /// \return  坐标系
        virtual Coordinate3d GetCoordinate()const = 0;

        /// \brief  获取二维曲线(拷贝实现)
        /// \return  二维曲线
        virtual OwnerPtr<ICurve2d> CopyCurve2d()const = 0;
        
        /// \brief  设置平面曲线所在的坐标系
        /// \param  coordinate3d      坐标系
        /// \return 成功返回true,否则返回false(默认返回True)
        virtual bool SetCoordinate(const Coordinate3d& coordinate3d)= 0;
        
        /// \brief 获取三维样条曲线
        /// 根据Planecurve3d中的nurbs2d的控制点和局部标架(坐标系)计算相应的nurbscurve3d
        /// \return 三维NURBS曲线
        virtual OwnerPtr<INurbsCurve3d> NurbsCurve() const = 0;
    public:
        virtual ~IPlaneCurve3d() {}
    };
}

